package com.weng.bigdata.core.warehouse.utils;

/**
 * 数仓命名工具类
 * @author wengzhonghui
 * @date 2021/3/24 18:42
 */
public class WarehouseNameRuleUtil {

	public static final String ODS_PREFIX = "ods";
	public static final String DWD_PREFIX = "dwd";
	public static final String DWS_PREFIX = "dws";
	public static final String ADS_PREFIX = "ads";
	public static final String DIM_PREFIX = "dim";
	public static final String TMP_PREFIX = "tmp";
	public static final String SPLIT = "_";

	/**
	 *  基于第三方源库的表获取ODS表名
	 * @param originTable, s]
	 * @return
	 */
	public static String getODSTableNameOfThirdDatabase(String originTable, String databaseCode){
		return ODS_PREFIX + SPLIT + databaseCode + SPLIT  + originTable;
	}

	/**
	 * 获取Etl临时存储表名
	 * @param targetTableName
	 * @return
	 */
	public static String getEtlIncTmpTable(String targetTableName){
		return TMP_PREFIX + SPLIT + targetTableName;
	}

	public static String getODSTableName(String originTable){
		return ODS_PREFIX + SPLIT + originTable;
	}

	public static String getDWDTableName(String originTable){
		return DWD_PREFIX + SPLIT + originTable;
	}

	public static String getDWSTableName(String originTable){
		return DWS_PREFIX + SPLIT + originTable;
	}

	public static String getADSTableName(String originTable){
		return ADS_PREFIX + SPLIT + originTable;
	}

	public static String getDIMTableName(String originTable){
		return DIM_PREFIX + SPLIT + originTable;
	}

	public static String getTMPTableName(String originTable){
		return TMP_PREFIX + SPLIT + originTable;
	}

}
